package com.yangjiangtao.spring_ioc.ioc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

// MoGong 和 LiuDeHua 实现了解耦，MoGong无需关注角色实现类的实例化工作
@Component
public class MoGong{
    @Autowired
    private GeLi geLi;

    public void cityGateAsk() {
        System.out.println("来者何人？");
        geLi.responseAsk("墨者革离！");
    }

}